<template>
  <div>
    <!-- 头部 -->
    <Header :header="header"></Header>
    <div class="nurContent f-clear">
      <div class="left-content f-left">
        <leftlist :list="list" @childBed="getBed"></leftlist>
      </div>
      <div class="right-content f-right">
        <rightlist :msg="[msg, bed]" @delAll="delHandle"></rightlist>
      </div>
    </div>
  </div>
</template>

<script>
import Header from '../../publicComponent/Header'
import leftlist from './leftList'
import rightlist from './rightList'

export default {
  data () {
    return {
      header: {
        tit: this.$route.query.key,
        backUrl: require('../../../static/images/back.png')
      },
      msg: '',
      bed: [],
      list: [
        { count: '01', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '02', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '03', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '04', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '05', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '06', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '07', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '08', name: '周芷若', gender: '女', num: '1005508934' },
        { count: '09', name: '周芷若', gender: '女', num: '1005508934' }
      ]
    }
  },
  created () {
    this.getquery()
  },
  methods: {
    getquery: function () {
      this.msg = this.$route.query.key
    },
    getBed: function (bed, ind) {
      this.bed = bed
      this.list.splice(ind, 1)
    },
    delHandle: function (id) {
      let index = this.bed.indexOf(id)
      this.bed.splice(index, 1)
      this.list.push({
        count: id,
        name: '周芷若',
        gender: '女',
        num: '1005508934'
      })
    }
  },
  components: {
    Header,
    leftlist,
    rightlist
  }
}
</script>

<style lang="stylus" scoped>
@import '../../../static/css/comm.css';

.nurContent {
  padding: 0.5rem 0.35rem 0.3rem 0.3rem;
  background-color: #f5f9fe;

  .left-content {
    width: 11.55rem;
  }

  .right-content {
    width: 6.75rem;
  }
}
</style>
